package vista;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.border.BevelBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class DlgGestionarTareas extends javax.swing.JDialog {

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	private JButton btSalir;
	private JButton btAceptar;
	private JPanel jPanel1;
	private JButton jButton1;
	private JTable tbTareas;
	private JScrollPane jScrollPane1;
	private JButton jButton2;

	/**
	* Auto-generated main method to display this JDialog
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				JFrame frame = new JFrame();
				DlgGestionarTareas inst = new DlgGestionarTareas(frame);
				inst.setVisible(true);
			}
		});
	}
	
	public DlgGestionarTareas(JFrame frame) {
		super(frame);
		initGUI();
	}
	
	private void initGUI() {
		try {
			{
				getContentPane().setLayout(null);
				this.setTitle("Gestionar Tareas");
				{
					btSalir = new JButton();
					getContentPane().add(btSalir);
					btSalir.setText("Salir");
					btSalir.setIcon(new ImageIcon(getClass().getClassLoader().getResource("iconos/Salir.gif")));
					btSalir.setHorizontalTextPosition(JButton.CENTER);
					btSalir.setVerticalTextPosition(JButton.BOTTOM);
					btSalir.setBounds(400, 231, 79, 40);
				}
				{
					btAceptar = new JButton();
					getContentPane().add(btAceptar);
					btAceptar.setText("Aceptar");
					btAceptar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("iconos/Aceptar.png")));
					btAceptar.setHorizontalTextPosition(JButton.CENTER);
					btAceptar.setVerticalTextPosition(JButton.BOTTOM);
					btAceptar.setBounds(302, 231, 79, 40);
				}
				{
					jPanel1 = new JPanel();
					getContentPane().add(jPanel1);
					jPanel1.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
					jPanel1.setLayout(null);
					jPanel1.setBounds(40, 29, 427, 172);
					{
						jButton1 = new JButton();
						jPanel1.add(jButton1);
						jButton1.setText("Quitar");
						jButton1.setIcon(new ImageIcon(getClass().getClassLoader().getResource("iconos/Quitar.png")));
						jButton1.setBounds(301, 126, 94, 27);
					}
					{
						jButton2 = new JButton();
						jPanel1.add(jButton2);
						jButton2.setText("Agregar");
						jButton2.setIcon(new ImageIcon(getClass().getClassLoader().getResource("iconos/Agregar.png")));
						jButton2.setBounds(28, 126, 103, 27);
					}
					{
						jScrollPane1 = new JScrollPane();
						jPanel1.add(jScrollPane1);
						jScrollPane1.setBounds(14, 14, 395, 96);
						{
							TableModel tbSucursalesModel = 
								new DefaultTableModel(
										new String[][] { { "One", "Two" }, { "Three", "Four" } },
										new String[] { "Tarea", "Costo" });
							tbTareas = new JTable();
							jScrollPane1.setViewportView(tbTareas);
							tbTareas.setModel(tbSucursalesModel);
							tbTareas.setBounds(86, 128, 261, 73);
						}
					}
				}
			}
			this.setSize(517, 338);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	DlgGestionarTareas dgtar=this;
	public void mostrar(JFrame frame) {
		
		setLocationRelativeTo(null);
		setVisible(true);
		
		
	
		
		
		btSalir.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				dgtar.dispose();
			}
		});
	}

}
